var a = getApp();

try {
    Page({
        data: {
            integral: "",
            placementId: null,
            mini_form_id: null,
            level_credit: 0,
            level_data: [],
            adv_list: [],
            member: {},
            level_index: 0
        },
        onLoad: function(a) {},
        onShow: function() {
            this.getData();
            var a = wx.getStorageSync("integral");
            a && this.setData({
                integral: a
            });
        },
        getADData: function(t) {
            2 != this.data.adv_info.adv_type ? (this.setData({
                placementId: t.target.dataset.id
            }), a.adConfig.app_id && a.adConfig.domain ? wx.navigateTo({
                url: "/packageI/AdBright/AdBrightPage/AdBrightPage?adv_id=" + this.data.placementId + "&wxad=" + this.data.mini_form_id
            }) : wx.showToast({
                icon: "none",
                title: "缺失广告配置信息",
                duration: 1e3
            })) : wx.navigateTo({
                url: "/packageI/AdBright/AdBrightWx/AdBrightWx?wxad=" + this.data.mini_form_id
            });
        },
        toPoint: function() {
            wx.navigateTo({
                url: "/packageI/AdBright/adBrightPoint/adBrightPoint"
            });
        },
        back: function() {
            try {
                wx.navigateBack({
                    delta: 1,
                    fail: function() {
                        wx.reLaunch({
                            url: "/packageG/index/index"
                        });
                    }
                });
            } catch (a) {
                wx.reLaunch({
                    url: "/packageG/index/index"
                });
            }
        },
        getData: function() {
            var t = this, e = a.getNetAddresss("plugin.flyers-advertise.frontend.mini.index");
            a._postNetWork({
                url: e,
                data: {
                    validate_page: 1
                },
                success: function(a) {
                    var e = a.data;
                    if (1 == e.result) {
                        var i;
                        e.data.level_data.forEach(function(a) {
                            a.level_id == e.data.member.level_id && (i = a.amount);
                        });
                        var n = 0;
                        e.data.level_data.forEach(function(a, t) {
                            a.level_id == e.data.member.level_id && (n = t);
                        }), t.setData({
                            mini_form_id: e.data.mini_form_id || "",
                            level_index: n,
                            level_data: e.data.level_data,
                            adv_list: e.data.adv_list,
                            adv_info: e.data,
                            member: e.data.member,
                            level_credit: i
                        });
                    } else wx.showToast({
                        icon: "none",
                        title: e.msg,
                        duration: 1e3
                    });
                },
                fail: function(a) {
                    console.log(a);
                }
            });
        },
        onReady: function() {},
        onHide: function() {},
        onUnload: function() {},
        onPullDownRefresh: function() {},
        onReachBottom: function() {},
        onShareAppMessage: function() {}
    });
} catch (a) {}